﻿<%@ Page Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true"
    CodeBehind="GoldBreed.aspx.cs" Inherits="Mang24k99.Web.ProductQuote.GoldBreed"
    Title="金品品种维护" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script type="text/javascript">
       //检查浏览器版本
        function detectBrowser()
        {
        var browser=navigator.appName
        var b_version=navigator.appVersion
        var version=parseFloat(b_version)

        if ((browser=="Netscape"||browser=="Microsoft Internet Explorer")
        && (version>=4))
          {alert("Your browser is good enough!")}
        else
          {alert("It's time to upgrade your browser!")}
          }

        function verify(e)
          { 
              var mykeycode=GetKeyCode(e);
              if(!(mykeycode>=48 && mykeycode<=57)&&!(mykeycode==8||mykeycode==9||mykeycode==13))
              { 
                  if(e.preventDefault) 
                  {
                    e.preventDefault();
                  }
                  else
                  {
                    e.returnValue=false;
                  }
              } 
          }
        function pageValidate()
        {
            var patrn=/^[0-9]{1,20}$/; 
            var breedno=document.getElementById("ctl00_ContentPlaceHolder1_txtBreedNO");
            var breedname=document.getElementById("ctl00_ContentPlaceHolder1_txtBreedName");
            if (breedno.value=="")
            {
                alert("代码不能为空！");
                return false;
            }
            if(!patrn.exec(breedno.value))
              {
                    alert("代码格式不对，请输入数字！");
                    return false;
              }
            if(breedname.value=="")
            {
                alert("名称不能为空！");
                return false;
            }
            return true;
        }
    </script>
    <table border="0" cellpadding="0" cellspacing="0" width="100%" height="34px" align="center"
        background="../Images/bg1.jpg">
        <tr>
            <td>
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </td>
            <td>
                <a class="col_on" href="GoldBreed.aspx?procduct_type=<%=product_type %>">金品品种维护</a>
            </td>
            <td>
                <a class="col" href="OrglistProduct.aspx?procduct_type=<%=product_type %>">机构经营产品维护</a>
            </td>
            <td>
                <a class="col" href="OrglistProductQuote.aspx?procduct_type=<%=product_type %>">产品报价</a>
            </td>
            <td>
                <a id="sort" runat="server" class="col" href="OrglistProductSort.aspx?procduct_type=2">首页排序</a>
            </td>
        </tr>
    </table>
    <table border="1" cellpadding="0" cellspacing="0" align="center"
        style="border-collapse: collapse">
        <tr>
            <td class="tb_title1">
                金品大类
            </td>
            <td class="tb_txt1">
                <asp:DropDownList ID="ddlGoldType" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="ddlGoldType_SelectedIndexChanged"  >
                </asp:DropDownList>
            </td>
        </tr>
    </table>
    <asp:Panel ID="Panel1" runat="server">
        <asp:Button ID="btnAdd" runat="server" CssClass="form_btn" Text="新增品种" 
            onclick="btnAdd_Click" />
    </asp:Panel>
    <asp:Panel ID="Panel2" runat="server">
        <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse">
            <tr>
                <td class="tb_title1">
                    品种代码
                </td>
                <td class="tb_txt1">
                    <asp:TextBox ID="txtBreedNO"  runat="server"  MaxLength="8" onkeypress="return verify(event)"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tb_title1">
                    品种名称
                </td>
                <td class="tb_txt1">
                    <asp:TextBox ID="txtBreedName"  MaxLength="20" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="tb_title1">
                </td>
                <td class="tb_txt1">
                    <asp:CheckBox ID="ckbHidden" runat="server" Text="隐藏报价显示" />
                </td>
            </tr>
        </table>
        <table>
            <tr>
                <td>
                    <asp:Button ID="btnSave" CssClass="form_btn" runat="server" Text="增加" 
                          OnClientClick="return pageValidate()" onclick="btnSave_Click" />
                    &nbsp;&nbsp;&nbsp; &nbsp;
                    <asp:Button ID="btnBack" CssClass="form_btn" runat="server" Text="返回" 
                        OnClientClick="return confirm('未保存的数据将丢失，你确定返回吗？')" onclick="btnBack_Click" />
                </td>
            </tr>
        </table>
    </asp:Panel>
    <asp:Panel ID="Panel3" runat="server">
             <div>
                <asp:GridView ID="grdList" runat="server" Width="100%"  OnRowDeleting="grdList_RowDeleting" 
                        AutoGenerateColumns="False" onselectedindexchanged="grdList_SelectedIndexChanged"
                        EmptyDataText="数据为空！" >
                    <HeaderStyle CssClass="tb_title2" />
                    <RowStyle CssClass="tb_txt2" />
                    <Columns>
                        <asp:TemplateField HeaderText="序号">
                            <ItemTemplate>
                                <%#Container.DataItemIndex+1%>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="BreedNO" HeaderText="编号" />
                        <asp:BoundField DataField="BreedName" HeaderText="品种名称" />
                        <asp:TemplateField HeaderText="报价显示">
                            <ItemTemplate>
                                <asp:Label ID="lbStatus" runat="server" Text='<%#GetCloseShow((int)Eval("CloseShow"))%>' ></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:ButtonField ButtonType="link" CommandName="Select" HeaderText="编辑" ShowHeader="True"
                            Text="编辑" />
                        <asp:CommandField DeleteText="&lt;div id=&quot;de&quot; onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;&gt;删除&lt;/div&gt; "  HeaderText="删除"
                            ShowDeleteButton="True" />
                    </Columns>
                </asp:GridView>
            </div>
    </asp:Panel>
</asp:Content>
